﻿{extend name='users/base'}
{block name="login_register"}
<div class="login_form">
    <div class="login_title">
        登录
    </div>

    <form action="" method="post" id="dologin">
        <input type="hidden" name="__token__" value="{:token()}"/>
		<input type="hidden" name="dosubmit" value="1"/>
        <div class="form_text_ipt">
            <input name="username" type="text" placeholder="手机号/邮箱">
        </div>
        <div class="ececk_warning"><span>数据不能为空</span></div>
        <div class="form_text_ipt">
            <input name="password" type="password" placeholder="密码">
        </div>
        <div class="ececk_warning"><span>数据不能为空</span></div>
        <div class="form_check_ipt">
            <div class="left check_left">
                <label><input name="autologin" type="checkbox"> 下次自动登录</label>
            </div>
            <div class="right check_right">
                <a href="#">忘记密码</a>
            </div>
        </div>
        <div class="form_btn">
            <button type="button" onclick="checkForm();">登录</button>
        </div>
        <div class="form_reg_btn">
            <span>还没有帐号？</span><a href="{:url('register/')}">马上注册</a>
        </div>
    </form>
    <div class="other_login">
        <div class="left other_left">
            <span>其它登录方式</span>
        </div>
        <div class="right other_right">
            <a href="#">QQ登录</a>
            <a href="#">微信登录</a>
        </div>
    </div>
</div>
<script>
    function checkForm(){
        var username = $("input[name='username']").val();
        var password = $("input[name='password']").val();
        if(!username || !password){
            alert('账号信息填写不完整');
            return false;
        }
        $('#dologin').submit();
    }
</script>
{/block}